<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<title>邀请会诊医生</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">		
	<link rel="stylesheet" href="css/mui.min.css">
	<link rel="stylesheet" href="css/grandeHealth.css">
	<link rel="stylesheet" type="text/css" href="css/myList.css"/>
	<style>
		.mui-checkbox.mui-left label, .mui-radio.mui-left label{padding: 0 0 0 35px;}
		.mui-checkbox.mui-left input[type=checkbox], .mui-radio input[type=radio]{top: 20px;left: 0;}
		#OA_task_2 .mui-row{border-bottom: 1px solid #eee;}
		.mui-table-view .mui-table-view-cell .kaoheDate{float: left;}
		
		.mui-search .mui-placeholder {line-height: 45px;}
		#pullrefresh{margin-top: 50px;}
		.mui-indexed-list{overflow: hidden;background:red;}
		
		
		
		
		#xzheader{background: pink;float:left;height: 50px;width: auto;max-width: 65%;}
		#xzheader img{width: 40px;margin:5px;}
		
		
		.mui-search {float:left;height: 50px;border: 1px solid green;max-width:100%;min-width: 30%;}
		input[type=search]{background: #fff;height: 45px;margin-bottom: 5px;}
		
		
		
		
	</style>
	</head>
	<body>
		<!--<header>class="mui-bar mui-bar-nav" style="display: block;height: 64px;padding-top:20px">
	      <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	      <h1 class="mui-title">邀请会诊医生</h1>
	      <button id="selectTem" disabled="disabled" style="float: right;">完成(0)</button>
	    </header>-->
	    
	    <div >
	    	<div id="xzheader">
				<img class="mui-pull-left" src="images/myHeader.png">
				<img class="mui-pull-left" src="images/myHeader.png">
				<img class="mui-pull-left" src="images/myHeader.png">
				<img class="mui-pull-left" src="images/myHeader.png">
				<img class="mui-pull-left" src="images/myHeader.png">
			</div>
			<div class="mui-indexed-list-search mui-search">
				<input type="search" id="searchInput" value="" class="inputValue mui-input-clear mui-indexed-list-search-input" placeholder="搜索">
			</div>
		</div>
	    
		<!--下拉刷新容器-->
	    <div class="mui-scroll-wrapper" id="pullrefresh">
      		<div class="mui-scroll">
	        	<!-- 数据列表 -->
				<ul id="OA_task_2" class="mui-table-view">
					<li class="mui-table-view-cell mui-table mui-row">
						<div class="mui-input-row mui-checkbox mui-left">
							<label>
								<img class="mui-pull-left" src="images/myHeader.png"> 
								<div class="mui-media-body">
									
									<p class="name">易小三</p>
									<span class="kaoheDate">内科		主任医师</span> 
								</div>
							</label>
							<input name="checkbox" class="checkbox" type="checkbox">
						</div>
					</li>
       			</ul>
      		</div>
	    </div>
	    
	    <!--暂无记录-->
	    <div class="mui-content" style="display: none;">
      		<div class="nomessage">
		        <img src="images/zanwujilu.png" />
		        <p>暂无记录</p>
      		</div>
	    </div>
		
		<script src="js/jquery-1.7.2.min.js"></script>
		<script src="js/mui.minT.js"></script>
		<script src="js/grandeHealth.js"></script>
		<script src="js/medicalRecord.js"></script>
		<script>
			var selectValueh = '';
			var hzDocAll = [];
			/*监听radio是否选中*/
			$("#OA_task_2").on("change",'input[type="checkbox"]',function(){
				
			    selectValueh = $('input:checkbox[name="checkbox"]:checked').parents('li').find('p').html();
				$('#selectTem').attr("disabled",null);
				hzDocAll.push(selectValueh)
				
			});
			
			/*选择确定*/
			mui("body").on("tap", "#selectTem", function() {
				
				yongyaofanan.update('hzDocAll',hzDocAll)

//				showpage('createPersonConsul.html');
			})
			
			
			
			
			
			var inputValue = $('#searchInput').val();
			var allUrl = XHDOC_WEBBASE + "v1/mpc/queryMultiDoctor?param=";
			var imgurl = XHDOC_WEBBASE + 'images/getimages?guid=';
			var webUrl ='';
			
//			var webUrl = XHDOC_WEBBASE + v1/mpc/queryMultiDoctor?param=丁

			/*
			 * keydown调用
			 */
			$('#searchInput').on('input propertychange', function() {
				
				inputValue = $(this).val();
				webUrl = allUrl + inputValue;
				//清空原有数据
				var table = document.body.querySelector('.mui-table-view');
            	table.innerHTML = '';
            	
            	pulldownRefresh();//调用
			});
			



//[{
//"id":"15288888888",
//"name":"丁医生",
//"refid":"e45642b05e5145df8dcdb3d15d19606b"
//},
//{
//"id":"15288888888",
//"name":"丁医生",
//"refid":"e45642b05e5145df8dcdb3d15d19606b"
//}]


			/**
		       * 页面初始化
	     	*/
			mui.init({
		        pullRefresh: {
		          	container: '#pullrefresh',
		          	down: {
		          		auto: true,
            			callback: pulldownRefresh,
		          	},
	          		up: {
			            contentrefresh: '正在加载...',
			            callback: pullupRefresh,
				      	contentnomore:'没有更多数据了'//可选，请求完毕若没有更多数据时显示的提醒内容；
	          		}
		        }
	      	});
	      	
	      	
			
			
			
			/**
		       * 下拉刷新具体业务实现
	     	*/
	      	function pulldownRefresh() {
	      		
	      		setTimeout(function () {
	     			
	     			count = 1;
	     			webUrl = allUrl + inputValue;
	     			jiaohu(webUrl, { 'pageNo': count }, function (data) {
						
						var table = document.body.querySelector('.mui-table-view');
//						table.innerHTML = '';
						
						//最新数据
						addContent(data, table);
						
						mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(null, "正在加载...");
						count++;
					});
					
	          	}, 1000);
	      	}
	
		    /**
		     * 上拉加载具体业务实现
		     */
	      	function pullupRefresh() {
	      		
	      		setTimeout(function () {
	      			
					webUrl = allUrl + inputValue;
					jiaohu(webUrl, { 'pageNo': count }, function (data) {
						
						var table = document.body.querySelector('.mui-table-view');
						
						//最新数据
						if (arry.parameterType == '') {
							
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(null, "没有更多数据了");
	
						} else {
							
							//最新数据
							addContent(data, table);
							count++;
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(null, "正在加载...");
						}
					});
	
				}, 1000);
	      	}
	
	      	
	      	function addContent(arry, table) {
				alert(array);
				alert(table);
				if (arry.parameterType == '') {
							
					$('.mui-content').show();

				} else {

					$('.mui-content').hide();
					
					for (var i = 0; i < arry.parameterType.length; i++) {
					
						var li = document.createElement('li');
						li.className = 'mui-table-view-cell mui-table mui-row';
						li.innerHTML = 
								'<div class="mui-input-row mui-checkbox mui-left">'+
									'<label>'+
										'<img class="mui-pull-left" src="images/myHeader.png">'+
										'<div class="mui-media-body">'+
											'<p class="name">'+arry.parameterType[i].name+'</p>'+
											'<span class="kaoheDate">'+arry.parameterType[i].deptnam+'<span style="margin-left:10px;">'+arry.parameterType[i].job+'</span></span>'+
										'</div>'+
									'</label>'+
									'<input name="checkbox" class="checkbox" type="checkbox">'+
								'</div>';
						table.appendChild(li);
					}
				}
			}
			
	    </script>
	</body>
</html>


